package com.hut.oa.configuration;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.hut.oa.interceptor.LoginInterceptor;

@Configuration
public class WebAppConfigurer extends WebMvcConfigurerAdapter {
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {

		//注册登录拦截器
		InterceptorRegistration loginReg = registry.addInterceptor(new LoginInterceptor());
		loginReg.addPathPatterns("/**").excludePathPatterns("/oa/login","/oa/captcha", "/error/**");
		
		super.addInterceptors(registry);
	}

}
